home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / cstdio.arc / SRC.ARC / LSEEK.A < prev    next >
Text File  |  1985-05-17  |  534b  |  31 lines

  1. ;    lseek.a - move read/write pointer.
  2. ;    (C) Copyright 1984, 1985 Gregory R. Mansfield - All Rights Reserved.
  3. ;    G. R. Mansfield.  84/06/22.
  4. ;    Ver 1.0-5517.
  5.  
  6.  
  7.     include    "include/msdos.ah"
  8.     dseg
  9.     public    errno_
  10.  
  11.     cseg
  12.     public    lseek_
  13.  
  14.  
  15. ;    long lseek(fd, n, o)
  16. ;    int fd, o;
  17. ;    long n;
  18.  
  19. lseek_:    mov    bx,sp
  20.     mov    ax,[bx+8]    ; origin
  21.     mov    cx,[bx+6]    ; offset
  22.     mov    dx,[bx+4]
  23.     mov    bx,[bx+2]    ; file handle
  24.     mov    ah,FR_MFP    ; move file pointer
  25.     int    I_FCN
  26.     jnb    lsk1        ; if no error
  27.     mov    errno_,ax
  28.     mov    ax,-1
  29.     mov    dx,ax
  30. lsk1:    ret
  31.